<?php

namespace Models;



class VoteUser extends BaseModel
{
    public function initialize()
    {
        $this->hasMany("vid", "Models\Vote", "id",array('alias' => 'vote'));
    }

//    public function validation()
//    {
//
//        $this->validate(new Uniqueness(array(
//            'field' => 'open_id'
//        )));
//        if ($this->validationHasFailed() == true) {
//            return false;
//        }
//    }


    public function  notSave()
    {
        $flash=$this->getDI()->getFlash();

        foreach($this->getMessages() as $message)
        {
            $flash->error($message);
        }
    }
}
